package hub.cathome.entity.tool;

import hub.cathome.entity.ResourceLink;

import java.io.File;

public class FileEraser {
    public synchronized static boolean erase(String resourcePath){
        File file = new File(ApplicationProperties.server_static_path+ File.separator+resourcePath);
        if(file.exists()){
            return file.delete();
        }else{
            return true;
        }
    }

    public synchronized static boolean erase(ResourceLink resourceLink) {
        return erase(resourceLink.getPath());
    }
}
